<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>试用提醒</title>
</head>
<style>
    *{
        margin: 0;
        padding:0;
        box-sizing: border-box;
        font-size: 16px;
    }
    html,body{
        width: 100%;
        height: 100%;
        background-color: rgba(239, 239, 244, 1);
    }

    .top{
        width: 100%;
        /*width:19.2rem;*/
        height:0.7rem;
        background:rgba(255,255,255,1);
        box-shadow:0rem 0rem 0rem 0rem rgba(0, 0, 0, 0.2);

        display: flex;
        align-items: center;
    }
    .top>div{
        width: 50%;
        text-align: center;
    }
    .top .Tleft img{
        width:1.86rem;
        height:0.45rem;
        /*width:0.93rem;*/
        /*height:0.225rem;*/
    }
    .top .Tright div{
        width:1.87rem;
        background:rgba(255,255,255,1);
        border:0px solid rgba(255,155,0,1);

        margin: 0 auto;
        display: flex;
        align-items: center;
    }
    .top .Tright div img{
        wedth:0.2rem;
        height: 0.2rem;
    }
    .top p{
        /*width:1.29rem;*/
        /*height:0.15rem;*/
        font-size:0.18rem;
        font-family:PingFangSC-Regular;
        font-weight:400;
        color:rgba(255,155,0,1);

        text-align: left;
        padding-left: 5px;
    }
    /*================================================*/
    .to0pen{
    }
    .main{
        width: 7.31rem;
        height: 4.71rem;
        background: inherit;
        background-color: rgba(255, 255, 255, 1);
        box-sizing: border-box;
        border-width: 0.01rem;
        border-style: solid;
        border-color: rgba(255, 255, 255, 1);
        border-radius: 0.03rem;

        margin: 0 auto;
        margin-top: 0.8rem;
        color: #333333;
        text-align: center;
    }
    .main>p{
        font-family: 'PingFangSC-Thin', 'PingFang SC Thin', 'PingFang SC';
        font-weight: 200;
        font-style: normal;
        font-size: 16px;
        text-align: center;
        color: #333333;
        text-align: center;
    }
    .main>p:nth-child(1){
        font-size: 25px;
        font-family: 'PingFangSC-Medium', 'PingFang SC Medium', 'PingFang SC';
        font-weight: 500;
        color: black;
        margin-top: 120px;
        margin-bottom: 30px;
    }
    .main>p:nth-child(1) span{
        color: red;
        font-size: 32px;
    }

    .main .submit{
        padding:0;
        width: 300px;
        height: 54px;
        background: inherit;
        background-color: rgba(255, 162, 23, 1);
        box-sizing: border-box;
        border-width: 1px;
        border-style: solid;
        border-color: rgba(255, 162, 23, 1);
        border-radius: 3px;
        color: #FFFFFF;

        margin-top: 40px;
        cursor: pointer;
    }
    .main .tips{
        font-size: 12px;
        color: #999999;
    }
    .main .tips a{
        text-decoration: none;
        font-size: 12px;
    }
    .main .input1{
        background: #cccccc;
    }


</style>
<body>
    <div class="container to0pen">
        <div class="top">
            <div class="Tleft">
                <img th:src="@{/img/logo@2x.png}" >
            </div>
            <div class="Tright">
                <div>
                    <img th:src="@{/img/Shape@2x.png}" >
                    <p>020-36523365</p>
                </div>
            </div>
        </div>
        <div class="main">
            <p>试用期还剩下：<span id="days"></span> 天</p>
            <p>亲，我们的产品对您有帮助吗？</p>
            <p>欢迎联系您的客户经理开通哦！如果有用得不爽的地方，也欢迎向我们反馈哦！</p>
                <button class="submit" id="countinueSubmit" onclick="countinue();">继续试用</button>
        </div>
    </div>

	<script th:inline="javascript"> var ctx = [[@{/}]]; var captchaType = [[${captchaType}]]; </script>
	<script src="../static/js/jquery.min.js" th:src="@{/js/jquery.min.js}"></script>
	<script src="../static/js/bootstrap.min.js" th:src="@{/js/bootstrap.min.js}"></script>
    <script>
        // 通过document.body.clientWidth网页可见区域的宽度
        var offWidth = document.body.clientWidth
        // 设计稿1rem = 100px
        document.getElementsByTagName("html")[0].style.fontSize = offWidth*(100/1920) + 'px'; //把rem的值复制给顶级标签html的font-size
        console.log('offWidth:'+offWidth)

        window.onresize = function(){
            location.reload()
        }
        
        function GetQueryString(name)
        {
             var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
             var r = window.location.search.substr(1).match(reg);//search,查询？后面的参数，并匹配正则
             
             if(r!=null)return  unescape(r[2]); return null;
        }
        
        var orgId = GetQueryString("orgId");
        var companyAccount = GetQueryString("companyAccount");
        var companyIp = GetQueryString("companyIp");
        var companyPort = GetQueryString("companyPort");
        var tokenParam = GetQueryString("tokenParam");
        var type = GetQueryString("type");
        var loginName = GetQueryString("loginName");
        var loginPwd = GetQueryString("loginPwd");
        
        //alert(tokenParam);
        
        function countinue(){
        	var url;
        	if(type == 'first'){
        		url = "http://"+companyIp+":"+companyPort+"/meals/firstRealLogin?loginName="+loginName+"&loginPwd="+loginPwd+"&orgId="+orgId+"&companyAccount="+companyAccount;
        		//url = "https://"+companyIp+":"+companyPort+"/meals/firstRealLogin?loginName="+loginName+"&loginPwd="+loginPwd+"&orgId="+orgId+"&companyAccount="+companyAccount;
        	}else{
        		url = "http://"+companyIp+":"+companyPort+"/meals/oaRealLogin?token="+encodeURIComponent(tokenParam);
        		//url = "https://"+companyIp+"/meals/oaRealLogin?token="+encodeURIComponent(tokenParam);
        	}
        	location.href = url;
        }
        
        $(function() {
	        $.ajax({
	            type: "get",
	            url: ctx + "abutment/getProbationDate",
	            data: {
	            	"orgId": orgId
	            },
	            success: function(r) {
	                if (r.code == 0) {
	                	var days = r.data.days;
	                	if(days<=0){
	                		$('#days').html(0);
	                		$("#countinueSubmit").attr('disabled',true);
	                		$("#countinueSubmit").css({'background-color':'grey'});
	                	}else{
	                		$('#days').html(days);
	                	}
	                } else {
	                	$.modal.closeLoading();
	                	$.modal.msg(r.msg);
	                }
	            }
	        });
        });
    </script>
</body>
</html>
